package ls.vuecp.action;

import java.awt.Event;

import javax.swing.Action;
import javax.swing.KeyStroke;

import tufts.vue.VueUtil;

public class Actions 
{
	
	public static final int COMMAND = VueUtil.isMacPlatform() ? Event.META_MASK : Event.CTRL_MASK;
    public static final int LEFT_OF_SPACE = VueUtil.isMacPlatform() ? Event.META_MASK : Event.ALT_MASK;
    public static final int CTRL = Event.CTRL_MASK;
    public static final int SHIFT = Event.SHIFT_MASK;
    public static final int ALT = Event.ALT_MASK;
    
    public static final int CTRL_ALT = VueUtil.isMacPlatform() ? CTRL+COMMAND : CTRL+ALT;
	
    private static final KeyStroke keyStroke(int vk, int mod) {
        return KeyStroke.getKeyStroke(vk, mod);
    }
    private static final KeyStroke keyStroke(int vk) {
        return keyStroke(vk, 0);
    }
    
    public static final VueAction defaultAction = new VueAction("Default");
    
    // --- File menu; --------------------------------------------------------------------
    
    public static final VueAction newMapAction = new VueAction("New Map");
    public static final VueAction openAction = new VueAction("Open");
    public static final VueAction openFromUrlAction = new VueAction("Open From URL");
    public static final VueAction closeMapAction = new VueAction("Close Map");
    
    public static final VueAction saveAction = new VueAction("Save");
    public static final VueAction saveAsAction = new VueAction("Save As");
    public static final VueAction revertAction = new VueAction("Revert");
    
    public static final VueAction quickImportAction = new VueAction("Quick Import");
    // pdf export sub menu;
    public static final VueAction fullPageSlideNotesAction = new VueAction("Full Pages Slide Notes");
    public static final VueAction slides8PerPageAction = new VueAction("Slide 8 per Page");
    public static final VueAction speakerNotes1Action = new VueAction("Speak Notes 1");
    public static final VueAction speakNotes4Action = new VueAction("Speak Notes 4");
    public static final VueAction audienceNotesAction = new VueAction("Audience Notes");
    public static final VueAction speakNotesOutlineAction = new VueAction("Speaker Notes Outline");
    public static final VueAction nodeNotes4Action = new VueAction("Node Notes 4");
    public static final VueAction nodeNotesOutlineAction = new VueAction("Node Notes Outline");
    //
    public static final VueAction printAction = new VueAction("Print");
    
    public static final ExitAction exitAction = new ExitAction("Exit");
    
    // --- Edit Menu action;------------------------------------------------------------
    
    public static final VueAction Undo = new VueAction("Undo");
    public static final VueAction Redo = new VueAction("Redo");
    
    public static final VueAction Cut = new VueAction("Cut");
    public static final VueAction Copy = new VueAction("Copy");
    public static final VueAction Paste = new VueAction("Paste");
    public static final VueAction Duplicate = new VueAction("Duplicate");
    public static final VueAction Rename = new VueAction("Rename");
    public static final VueAction Delete = new VueAction("delete");
    
    public static final VueAction SelectAll = new VueAction("Seletct All");
    public static final VueAction SelectAllNodes = new VueAction("Select All Nodes");
    public static final VueAction SelectAllLinks = new VueAction("Select All Lines");
    public static final VueAction ExpandSelection = new VueAction("Expand Selection");
    public static final VueAction ShrinkSelection = new VueAction("Shrink Selection");
    public static final VueAction Reselect = new VueAction("Reselect");
    public static final VueAction DeselectAll = new VueAction("Deselect All");
    
    public static final VueAction Preferences = new VueAction("Preferences");
    
    // --- View menu actions;----------------------------------------------------------
    
    public static final VueAction ZoomIn = new VueAction("Zoom In");
    public static final VueAction ZoomOut = new VueAction("Zoom Out");
    public static final VueAction ZoomFit = new VueAction("Zoom Fit");
    public static final VueAction ZoomToSelection = new VueAction("Zoom to Selection");
    public static final VueAction ZoomActual = new VueAction("Zoom Actual");
    
    public static final VueAction ToggleFullScreen = new VueAction("Toggle Full Screen");
    public static final VueAction SuperScreen = new VueAction("Super Screen");
    public static final VueAction KioskScreen =new VueAction("Kiosk Screen");
    
    public static final VueAction ToggleGlobalCollapse = new VueAction("Toggle Global Collapse");
    public static final VueAction Collapse = new VueAction("Collapse");
    public static final VueAction ClearAllPruning = new VueAction("Clear All Pruning");
    
    // --- format menu actions;-------------------------------------------------------
    
    public static final VueAction AlignLeftEdges = new VueAction("Align Left Edges");
    public static final VueAction AlignRightEdges = new VueAction("Align Right Edges");
    public static final VueAction AlignTopEdges = new VueAction("Align Top Edges");
    public static final VueAction AlignBottomEdges = new VueAction("Align Bottom Edges");
    public static final VueAction AlignCentersRow = new VueAction("Align Centers Row");
    public static final VueAction AlignCentersColumn = new VueAction("Align Centers Column");
    public static final VueAction FillWidth = new VueAction("Fill Width");
    public static final VueAction FillHeight = new VueAction("Fill Height");
    public static final Action[] ALIGN_MENU_ACTIONS = {
        AlignLeftEdges,
        AlignRightEdges,
        AlignTopEdges,
        AlignBottomEdges,
        null,
        AlignCentersRow,
        AlignCentersColumn,
        null,
        FillWidth,
        FillHeight
    };

    public static final VueAction MakeRow = new VueAction("Make Row");
    public static final VueAction MakeColumn = new VueAction("Make Column");   
    public static final VueAction PushOut = new VueAction("Push Out");
    public static final VueAction PullIn = new VueAction("Pull In");
    public static final VueAction DistributeVertically = new VueAction("Distribute Vertically");
    public static final VueAction DistributeHorizontally = new VueAction("Distribute Horizontally");
    public static final VueAction BringToFront = new VueAction("Bring To Front");
    public static final VueAction SendToBack = new VueAction("Send To Back");
    public static final Action[] ARRANGE_MENU_ACTIONS = {
        MakeRow,
        MakeColumn,
        null,
        LayoutAction.table,
        LayoutAction.circle,
        LayoutAction.filledCircle,
        LayoutAction.random,
        LayoutAction.ripple,
        LayoutAction.cluster2,
        null,
        PushOut,
        PullIn,
        //PushOutLinked,
        null,
        DistributeVertically,
        DistributeHorizontally,
        null,
        BringToFront,
        SendToBack
    };
    public static final VueAction MakeCluster = new VueAction("Make Cluster");
    public static final VueAction PullInLinked = new VueAction("Pull in Linked");
    public static final VueAction PushOutLinked = new VueAction("Push out Linked");
    public static final VueAction MakeDataLists = new VueAction("Make Data Lists");
    
    public static final LWCAction LinkMakeStraight = new LWCAction("Linke Make Straight");
    public static final LWCAction LinkMakeQuadCurved = new LWCAction("Link Make Quad Curved");
    public static final LWCAction LinkMakeCubicCurved = new LWCAction("Link Make Cubic Curved");
    public static final LWCAction LinkArrows = new LWCAction("Link Arrows");
    public static final Action[] LINK_MENU_ACTIONS = {
        LinkMakeStraight,
        LinkMakeQuadCurved,
        LinkMakeCubicCurved,
        LinkArrows
    };
    
    public static final LWCAction Group = new LWCAction("Group");
    public static final LWCAction Ungroup = new LWCAction("Ungroup");
    
    // transform 
    public static final VueAction FontBigger = new VueAction("Font Bigger");
    public static final VueAction FontSmaller = new VueAction("Font Smaller");
    public static final VueAction FontBold = new VueAction("Font Bold");
    public static final VueAction FontItalic = new VueAction("Font Italic");
    public static final VueAction FontUnderline = new VueAction("Font Underline");
    public static final VueAction ResizeNode = new VueAction("Resize Node");
    public static final Action [] NODE_FORMAT_MENU_ACTIONS = {ResizeNode};
    
    public static final VueAction ImageBigger = new VueAction("Image Bigger");
    public static final VueAction ImageSmaller = new VueAction("Image Smaller");
    public static final VueAction ImageToNaturalSize = new VueAction("Image to Natural Size");
    public static final VueAction ImageHide = new VueAction("Image Hide");
    public static final VueAction ImageShow = new VueAction("Image Show");
    private static final int ImageSizes[] = { 1024, 768, 640, 512, 384, 256, 128, 64, 32, 16 };
    public static final Action[] IMAGE_MENU_ACTIONS;
    static {

        IMAGE_MENU_ACTIONS = new Action[ImageSizes.length + 5];

        int i = 0;
        
        IMAGE_MENU_ACTIONS[i++] = ImageBigger;
        IMAGE_MENU_ACTIONS[i++] = ImageSmaller;
        IMAGE_MENU_ACTIONS[i++] = ImageToNaturalSize;

        for (int x = 0; x < ImageSizes.length; x++) {
            IMAGE_MENU_ACTIONS[i++] = new ImageSizeAction(ImageSizes[x]);
        }

        IMAGE_MENU_ACTIONS[i++] = ImageHide;
        IMAGE_MENU_ACTIONS[i++] = ImageShow;

    }
    
    // --- help menu ---------------------------
    public static final VueAction About = new VueAction("About");
}
